<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:pe="http://primefaces.org/ui/extensions"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:fn="http://java.sun.com/jsp/jstl/functions">
    <ui:composition template="/layout/masterpage_admin.xhtml">
        <f:metadata>
            
            <f:event type="preRenderView" listener="#{sys_NguoiDungController.onPageLoad_CheckAdmin()}">
                
            </f:event>
        </f:metadata>
        
         <ui:define name="ui-header">
             <title>#{utilsController.getLanguages("TaoMoiCapNhat")}</title>
        </ui:define>
        
        
        <ui:define name="ui-content">
            <div class="panel panel-blue margin-bottom-40">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="fa fa-tasks"></i> #{utilsController.getLanguages("Blog")}</h3>
                </div>
                <div class="panel-body"> 
                    <h:form class="margin-bottom-40" id="frmblog">
                        <p:growl id="growl" showDetail="true" sticky="true" escape="false" /> 
                        <h:panelGroup layout="block" id="pnHinhAnh" styleClass="custom-input-group" >
                            <p:fileUpload fileUploadListener="#{c_BlogController.handleFileUpload}" mode="advanced" dragDropSupport="false" auto="true"
                                          style="display: none;visibility: hidden;" allowTypes="/(\.|\/)(gif|jpe?g|png)$/"  update=":frmblog:pnHinhAnh"   
                                          />
                             <a href="javascript:void(0)" onclick="$('.custom-input-group .ui-fileupload-choose input').click();">
                                 <p:graphicImage  value="#{c_BlogController.item.fileHinhAnh==null?c_BlogController.getFullPathHinhAnh(c_BlogController.item.hinhAnh):c_BlogController.item.fileHinhAnh}" width="120px" height="120px"  cache="false">

                                </p:graphicImage>
                            </a>
                        </h:panelGroup>
                        <div class="form-group">
                            <label for="txtTieuDe">#{utilsController.getLanguages("TieuDe")}</label>
                            <h:inputText class="form-control" id="txtTieuDe" value="#{c_BlogController.item.tieuDe}"/>
                        </div>
                       <div class="form-group">
                            <label for="txtTomTat">#{utilsController.getLanguages("TomTat")}</label>
                            <pe:ckEditor id="txtTomTat" value="#{c_BlogController.item.tomTat}"/>
                        </div>
                        <div class="form-group">
                            <label for="txtNoiDung">#{utilsController.getLanguages("NoiDung")}</label>
                            <pe:ckEditor id="txtNoiDung" value="#{c_BlogController.item.noiDung}"/>
                        </div>
                        <button class="btn-u btn-u-blue" type="button" onclick="Save_Blog_Click();">#{utilsController.getLanguages("Save")}</button>
                        <a href="/Admin/c/blog.html" class="btn-u btn-u-aqua">#{utilsController.getLanguages("Cancel")}</a>
                        <p:remoteCommand name="Save_Blog" actionListener="#{c_BlogController.btnSave_Click}" update=":frmblog"></p:remoteCommand>
                        
                    </h:form>
                </div>
            </div>
            
        </ui:define>
    </ui:composition> 
</html>